package com.mikey.function;

import java.util.function.Predicate;

/**
 * @author :Mikey
 * @description :Predicate 断定型接口，有一个输入参数，返回值bolean
 * @create :2022-09-22 10:54:00
 */
public class Demo1 {
    public static void main(String[] args) {
        //判断字符串是否为空
        Predicate<String> predicate = new Predicate<String>() {
            @Override
            public boolean test(String o) {
              return o.isEmpty();
            }
        };
        Predicate<String> predicate1=(o)->{return o.isEmpty();};
        System.out.println(predicate.test("123"));
    }
}
